$('button').click(function (){
  username = $('.username').val();
    if (!username.match(/^\w{3,20}@\w{2,6}\.[a-zA-Z\.]{2,6}$/)) {
        alert("邮箱不正确");
      
    } 
    password = $('.password').val();
    if (!password.match(/^\w{6,12}$/)) {
      alert("密码不正确");
    } 
     $.ajax({
                url: "login1.php",
                type: 'POST',
                //{"后端的username":前端}
                data: {"username": username, "password": password},
                success: function (data) {
                  
              if (data == "yy") {
                location.href = "myindex.php";
            } else {
                alert("账号密码错误");
             
            }
                }
            });
})


